package engine.light;

import engine.shader.Shader;

public class EnvironmentLight extends Light{

	private float[] ambient;
	private float[] direction;
	
	public EnvironmentLight() {
		super();
		
		ambient = new float[]{0, 0, 0, 1};
		direction = new float[]{0, 0, 0, 0};
	}
	
	public float[] getAmbient() {
		return ambient;
	}
	
	public void setAmbient(float r, float g, float b) {
		ambient[0] = r;
		ambient[1] = g;
		ambient[2] = b;
	}
	
	public float[] getDirection() {
		return direction;
	}
	
	public void setDirection(float x, float y, float z) {
		direction[0] = x;
		direction[1] = y;
		direction[2] = z;
	}
	
	@Override
	public void apply(Shader shader, int lightSource) {
		super.apply(shader, lightSource);
		
		shader.sendUniform4f("lights[" + lightSource + "].ambient", ambient);
		shader.sendUniform4f("lights[" + lightSource + "].position", direction);
	}
}
